<template>
    <div>
    <myheader></myheader>

    <br>

    <Breadcrumb :datas="datas"></Breadcrumb>
    <section class="featured-block text-center">
            商品分类名称：<input type="text" v-model="catename">


        <br>

        <Button @click="submit">修改分类</Button>

    </section>
    
    <myfooter></myfooter>
    </div>
</template>

<script>
//组件包含
import myheader from "./myheader.vue";
import myfooter from "./myfooter.vue";

export default {
    name:'changecate',
    data() {
        return {
            //面包屑导航
            datas:[{"title":'修改商品分类'}],
            catename:"",
            cid:"",
        }
    },
    components: {
        myheader: myheader,
        myfooter: myfooter,
    },
    methods: {
        submit(){
            this.axios({
                method:'post',
                url:'http://127.0.0.1:8000/category/',
                data:{ 
                    catename : this.catename,
                    id: this.$route.query.id,
                },
            }).then(resp=>{
                if (resp.data.code == 200) {
                    console.log(resp)
                    this.$Message(resp.data.msg)
                }
            }).catch(error=>{
                console.log(error)
            })
        },
    },
}
</script>

<style>

</style>